<?php
include_once("../config.php");
$uid = $_GET['uid'];
//$id = $_GET['id'];
//$zt = $_GET['zt'];
$yj = $_GET['yj'];
//$yzt = $_GET['yzt'];
$uid = str_ireplace($search, '', $uid);
$yj = str_ireplace($search, '', $yj);
$id=intval($_GET['id']);
$zt=intval($_GET['zt']);
$yzt=intval($_GET['yzt']);

$sql = "select status from wenti where id=$id";
$requ=mysqli_query($con,$sql);
$rs=mysqli_fetch_array($requ);
if($rs['status']!=$yzt){
	die('{"status":"-1","msg":"此单已被处理"}');
}

$sql = "select qianming from user where openid='$uid'";
$requ=mysqli_query($con,$sql);
$rs=mysqli_fetch_array($requ);
$qm=$rs['qianming'];
$t=time();
$sql = "update wenti set status=$zt,shsj=$t,shyj='$yj',xxzxqm='$qm',xxzxshz='$uid' where id=$id";
mysqli_query($con,$sql);
if(mysqli_affected_rows($con)){
	$result='{"status":"1","msg":"ok"}';
}else{
	$result='{"status":"0","msg":"失败，请重试。"}';
}
echo $result;
